Advanced C++ by Gazihan Alankus Olena Lizina Rakesh Mane Vivek Nagarajan and Brian Price

Advanced C++ by Gazihan Alankus Olena Lizina Rakesh Mane Vivek Nagarajan and Brian Price

Author:Gazihan Alankus, Olena Lizina, Rakesh Mane, Vivek Nagarajan, and Brian Price
Language: eng
Format: epub
Publisher: Packt Publishing Pvt Ltd
Published: 2019-10-30T00:00:00+00:00


Exercise 4: Creating and Working with an STL Container of Threads

In this exercise, we will write a simple application where we will use std::move() with threads. First of all, we will implement a class that is move constructible. This class will convert lowercase text into uppercase text. Then, we will create a vector of instances of this class. Next, we will create a vector of std::thread objects. Finally, we will initialize the threads with an object from the first vector.

Perform the following steps to complete this exercise:

Include headers for threading support, namely <thread>, streaming support, namely <iostream>, and <vector>:#include <iostream>

#include <thread>

#include <vector>

#include <string>



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.